﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using MP.Core.Config;

namespace MP.Core.Authentication.Entity
{
    public class RoleAction
    {
        public string RoleName { get; set; }
        public string ModCode { get; set; }
        public bool IsShow { get; set; }
        public bool IsShowToUser { get; set; }
        public bool IsAdd { get; set; }
        public bool IsEdit { get; set; }
        public bool IsEditToUser { get; set; }
        public bool IsDelete { get; set; }
        public bool IsDeleteToUser { get; set; }
        public bool IsEnable { get; set; }
        public bool IsDisable { get; set; }
        public Hashtable Items { get; set; }

        public RoleAction()
        {
            Items = new Hashtable();
        }

        public void UpdateFields()
        {
            //RoleName = Items["RoleName"].ToString();
            //ModCode = Items["ModeCode"].ToString();
            IsShow = (bool)Items[EnumActions.SHOW];
            IsShowToUser = (bool)Items[EnumActions.SHOW_TO_USER];
            IsAdd = (bool)Items[EnumActions.ADD];
            IsEdit = (bool)Items[EnumActions.EDIT];
            IsEditToUser = (bool)Items[EnumActions.EDIT_TO_USER];
            IsDelete = (bool)Items[EnumActions.DELETE];
            IsDeleteToUser = (bool)Items[EnumActions.DELETE_TO_USER];
            IsEnable = (bool)Items[EnumActions.ENABLE];
            IsDisable = (bool)Items[EnumActions.DISABLE];
        }
    }
}
